<%@page import="com.iss.iframework.util.DateUtil"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@page import="com.iss.umservice.bean.ServiceBean"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="/taglibs/iss" prefix="iss"%>
<%@page import="com.iss.umservice.common.Week"%>
<%@page import="com.iss.umservice.bean.ServiceApplyBean"%>
<%@page import="java.util.List"%>
<%@page import="java.util.Date"%>

<HTML>
<HEAD>
<TITLE>MKTB15</TITLE>
<LINK href="../css/IDEA.css" type=text/css rel=stylesheet>
<SCRIPT language=javascript src="../js/IDEA_body.js"
	type=text/javascript></SCRIPT>
<script src="../js/main.js" language="javascript" type="text/javascript"></script>
<link rel="stylesheet" href="../css/validationEngine.jquery.css"
	type="text/css" />
<script src="../js/jquery-1.6.min.js" type="text/javascript"></script>
<script src="../js/languages/jquery.validationEngine-zh_CN.js"
	type="text/javascript" charset="utf-8"></script>
<%
	ServiceBean serviceBean = (ServiceBean) request
			.getAttribute("serviceBean");
%>
<script src="../My97DatePicker/WdatePicker.js" language="JavaScript"
	type="text/JavaScript"></SCRIPT>
<script src="../js/jquery.validationEngine.js" type="text/javascript"
	charset="utf-8"></script>
<script>
	jQuery(document).ready(function() {
		jQuery("#mainForm3").validationEngine({
			autoHidePrompt : true
		});
	});
	var tabLeftOn = "../images/pic_title_1.jpg";
	var tabRightOn = "../images/pic_title_2.jpg";
	var tabLeftOff = "../images/pic_title_4.jpg";
	var tabRightOff = "../images/pic_title_4.jpg";
</script>

</HEAD>

<body>
	<TABLE width="100%" height="100%" border=0 cellPadding=0 cellSpacing=0>
		<TBODY>
			<TR>
				<TD height="100%" bgcolor="#FFFFFF" class=right_bg><iss:blank />
					<table width="100%" border="0" align="center" cellpadding="0"
						cellspacing="0">
						<tr>
							<td width="20">&nbsp;</td>
							<td class="text_12_title">当前位置: <a href="#" class="blue_1">首页</a>
								&gt; <a href="#"
								class="blue_1">共享资源申请 
							</td>
						</tr>
					</table>

					<table width="98%" border="0" cellpadding="0" cellspacing="0"
						background="../images/bg_body_title.jpg" class="list_border1">
						<tr>
							<td width="10">&nbsp;</td>
							<td>
								<table border="0" cellspacing="0" cellpadding="0">
									<tr>
										<td><img src="../images/pic_title_1.jpg" name="imgL1"
											width="8" height="24" id="imgL1"></td>
										<td valign="bottom" class="text_12_border" nowrap="nowrap"
											style="cursor: hand;" id="tdTitle1">会议室(${serviceName})未来7天的预定情况</td>
										<td><img src="../images/pic_title_2.jpg" name="imgR1"
											width="8" height="24" id="imgR1"></td>
									</tr>
								</table>
							</td>
						</tr>
					</table>
					<iss:blank/>
					<table width="98%" border="1" cellpadding="1" cellspacing="1"
						background="../images/bg_body_title.jpg" class="list_border1">
						<TR class="list_td_white1" align="center">
							<td>时间</td>
							<td>${week.currentDate}</td>
							<td>${week.date2}</td>
							<td>${week.date3}</td>
							<td>${week.date4}</td>
							<td>${week.date5}</td>
							<td>${week.date6}</td>
							<td>${week.date7}</td>
						</TR>
						<% 
						List<ServiceApplyBean> list = (List<ServiceApplyBean>)request.getAttribute("servcieApplyList");
							Week week = (Week)request.getAttribute("week");
						String startTime="08:00";
						boolean isYellow= false;
						for(int i=1;i<=20;i++)
						{
							startTime = week.getAfter30Min(startTime);

						 %>
						<TR class="list_td_white2" height="10" align="center" >
							<td><%=startTime%>~<%=week.getAfter30Min(startTime)%></td>
							<%
							
							for(int j = 0;j<7;j++)
							{
							String currentDate=DateUtil.dateToStr(DateUtil.addDay(new Date(), j));
							%>
							<td
							<%
							for(ServiceApplyBean meeting:list)
							{
								if(week.before(meeting.getStartUseTime(),currentDate +" "+startTime )&&
								week.before(currentDate+" "+week.getAfter30Min(startTime),meeting.getEndUseTime()))
								{
									%>
							style="background-color:yellow" title="<%=meeting.getCompanyName()%>:<%=meeting.getStartUseTime()%>~~<%=meeting.getEndUseTime() %>"
							
							<%
							isYellow=true;
							break;
								}							
							}
							if(!isYellow)
							{								
								%>
								style="background-color:green"
								<%
							}
							isYellow=false;
							%>
							>
							</td>

							<%}%>

						</TR>
						<%	} %>

					</table>
				</TD>
			</TR>
		</TBODY>
	</TABLE>
</body>
</HTML>